package com.yc.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yc.entities.BloodSugarGluce;
import com.yc.entities.BloodSugarPatientInfo;
import com.yc.entities.custom.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 患者信息表 Mapper 接口
 * </p>
 *
 * @author kuakha
 * @since 2021-04-12
 */
public interface BloodSugarPatientInfoMapper extends BaseMapper<BloodSugarPatientInfo> {

    List<AppHomePageUserBean> appHomePageAllPatientInfo(BloodSugarPatientInfo bloodSugarPatientInfo);

    List<AppHomePageUserBean> appHomePageConcernsPatientInfo(BloodSugarPatientInfo bloodSugarPatientInfo);

    int insertPatient(BloodSugarPatientInfo patientInfo);

    List<CustomBarCodeResponseBean> getAllRoleInfo(Page<Integer> page, @Param("deanId") Integer deaId, @Param("departmentId") Integer departmentId);

    List<CustomDataQueryResponseBean> getAllDataInfo(Page<CustomDataQueryRequestBean> page,@Param("customDataQueryRequestBean") CustomDataQueryRequestBean customDataQueryRequestBean);

    List<CustomOutPatientQueryResponseBean> getAllOutPatientInfo(Page<CustomOutPatientQueryRequestBean> page, @Param("customOutPatientQueryRequestBean") CustomOutPatientQueryRequestBean customOutPatientQueryRequestBean);

    List<CustomIndexQueryResponseBean> getAllIndexInfo(/*Page<CustomIndexQueryRequestBean> page,*/@Param("customIndexQueryRequestBean") CustomIndexQueryRequestBean customIndexQueryRequestBean);

    CustomPatientInfoResponseBean getPatientById(Integer id);

    int savePatientInto(CustomPatientSaveRequestBean customPatientSaveRequestBean);

    BloodSugarPatientInfo getBloodSugarPatientInfoByType(@Param("toHospitalNum")String toHospitalNum,
                                                         @Param("phone")String phone,@Param("bedNum")String bedNum,@Param("departmentId")String departmentId
            ,@Param("doctorId")String doctorId);

    List<GluceDataTable> getIndexUserBloodGlucoseInfo( @Param("id") Integer id, @Param("startTime") String startTime, @Param("endTime") String endTime);
//    List<GluceDataTable> getIndexUserBloodGlucoseInfo(Page<Integer> page, @Param("id") Integer id, @Param("startTime") String startTime, @Param("endTime") String endTime);

    List<CustomOutInRecordResponseBean> getIndexUserOutInHospitalRecord(Page<Integer> page, String hospitalNum);

    List<Map<String,Object>> getIndexUserBloodGlucoseDetail(@Param("id") Integer id, @Param("time") String time, @Param("attr") String attr);

    List<CustomDataBean> getDataUserLineChartInfo(@Param("id") Integer id, @Param("attr") String attr, @Param("startTime") String startTime, @Param("endTime") String endTime);

    List<AppHomePageUserBean> appHomePageToBeMeasuredInfo(BloodSugarPatientInfo bloodSugarPatientInfo);

    List<AppHomePageUserBean> abnormalDataByUser(BloodSugarPatientInfo bloodSugarPatientInfo);
}